<template>
  <div class="SetGroup">
    <div class="SetGroup_head">
      <van-icon name="arrow-left" @click="back" />
      <h3>创建团购</h3>
      <p>
        <van-icon name="ellipsis" />
        <van-icon name="award-o" />
      </p>
    </div>
    <div class="SetGroup_main">
      <van-uploader v-model="img" multiple />

      <input type="text" placeholder="标题" v-model="name" />
      <input type="text" placeholder="地址" v-model="address" />
      <input type="text" placeholder="日期" v-model="time" />
      <input type="text" placeholder="报名" v-model="peopleNum" />
    </div>

    <div class="SetGroup_footer">
      <button @click="setgroup">创建团建</button>
    </div>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      img: [],
      name: [],
      address: [],
      time: [],
      peopleNum: [],
      addlist: [],
    };
  },
  methods: {
    //返回上一页
    back() {
      history.go(-1);
    },

    setgroup() {
      axios
        .post("/addTeamBuy", {
          name: this.name,
          time: this.time,
          address: this.address,
          peopleNum: this.peopleNum,
        })
        .then((res) => {
          console.log(res);
        });
    },
  },
  created() {
   
  },
};
</script>

<style>
.SetGroup {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}
.SetGroup_head {
  width: 100%;
  height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  background: #2693fa;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 999;
}
.SetGroup_head p {
  border: 1px solid #e6e6e6;
  border-radius: 40px;
}
.SetGroup_head p .van-icon {
  padding: 4px 10px;
}
.SetGroup_main {
  flex: 1;
  overflow-y: scroll;
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* .van-uploader {
  width: 95%;
  height: 150px;
  border: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.van-uploader__wrapper {
  width: 100%;
  height: 100%;
  position: relative;
}
.van-uploader__input-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.van-uploader__preview {
  z-index: 1;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.van-image {
  width: 100%;
  height: 100%;
}
.img {
  width: 100%;
  height: 150px;
} */
.SetGroup_main input {
  width: 95%;
  padding: 15px 0;
  margin: 20px 0;
}
.SetGroup_footer {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.SetGroup_footer button {
  width: 100%;
  padding: 15px 0;
  border: none;
  background: #2693fa;
  color: #fff;
}
</style>